home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1989 January
/
Ahoy_Magazine_89-01_1989_Double_L.d64
/
Team Play
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
778b
|
34 lines
0 print"[147] team play":print
1 rem ==================================
2 rem commodares problem #57-2 :
3 rem team play
4 rem solution by
5 rem fred ransom
6 rem ==================================
10 input "number of teams";n
20 dim t$(n): print"give team names:"
30 for k=0 to n-1
40 print"team number ";k+1;: input t$(k)
50 next k
55 if (n and 1) then n=n+1:t$(n-1)="---"
60 input "to (p)rinter or (s)creen [s]";fl$
70 dev=3 : if fl$="p" then dev=4
80 open 4,dev
90 for j=1 to n-1
100 for a=1 to 3 : print#4 : next
110 print#4,"round ";j
120 print#4,"home", "away"
130 print#4,"======", "======"
140 for k=0 to (n/2-1)
150 if (j and 1)=1 then print#4, t$(k), t$(k+n/2)
160 if (j and 1)=0 then print#4, t$(k + n/2), t$(k)
170 next k
180 a$=t$(1)
190 if n < 3 then 240
200 for k=2 to n-1
210 t$(k-1)=t$(k)
220 next k
230 t$(n-1)=a$
240 next j
250 close 4